home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Misc. Utilities / Installer / Installer 3.2 / Samples - Installer 3.2 / ActionAtomSample.r < prev    next >
Encoding:
Text File  |  1992-01-22  |  5.5 KB  |  177 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: Action Atoms
  6.  *
  7.  *    File:        ActionAtomSample.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *
  11.  *    Copyright © 1991 Apple Computer, Inc.
  12.  *    All rights reserved.
  13.  *
  14.  *------------------------------------------------------------------------------
  15.  *
  16.  * Install application "TheProgram" into the folder "Root":Installed Application.
  17.  * It demonstrates implementation of an action atom.
  18.  *----------------------------------------------------------------------------*/
  19. /*
  20.  
  21. You can build the script with the following lines:
  22.  
  23.         rez  -o "ActionAtomSample" -t 'bjbc' -c 'bjbc' "ActionAtomSample.r"
  24.         setfile -a i "ActionAtomSample"
  25.         scriptcheck -p "ActionAtomSample"
  26.  
  27. ------------------------------------------------------------------------------------------
  28. */
  29.  
  30. #include "Types.r"
  31. #include "InstallerTypes.r"
  32. #include "ActionAtomSelectors.h"
  33.  
  34. /* 'inaa' code resource definition */
  35. #define        aaCodeID                128
  36.  
  37. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  38. #define kScriptCheckSetsDate    0x01
  39.  
  40. /* Definitions for the file spec atoms (specifications for source and destination files) */
  41. #define fsSourceProgram            2000
  42. #define fsTargetProgram            2001
  43.  
  44. /* This is the name of the source disk */
  45. #define ProgramDisk "Program Disk:"
  46.  
  47. /* where we want to install our file. */
  48. #define TargetPath    ":Installed Application:"
  49.  
  50. /* Definition for the package. */
  51. #define pkTheProgram            3000
  52.  
  53. /* Definition for the file atom */
  54. #define faProgram                4000
  55.  
  56. /* Definition for the package comment resource */
  57. #define cmtTheProgram            5000
  58.  
  59. /* Definitions for the action atom resources */
  60. #define aaAlertID                6000
  61.  
  62. /* October 10, 1990 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  63. /* this value to a LongInt seconds value needed by the Installer. */
  64. #define currentReleaseDate        10101990        
  65. #define currentVersion            100     /* Version 1.0 goes in the 'icmt' rsrc */
  66.  
  67. #define iconTheProgram            5100
  68.  
  69. /************************** Easy Install Rule resources **********************************/
  70.  
  71. /***************************** Package Resources ************************************************/
  72. resource 'inpk' (pkTheProgram) {
  73.     format0 {
  74.         ShowsOnCustom,                 /* Package appears in the Custom Install display */
  75.         Removable,                    /* Package can be removed */
  76.         dontForceRestart,            /* no need to restart */
  77.         cmtTheProgram,                 /* package's 'icmt' resource id */
  78.         0,                            /* Package size (filled in by ScriptCheck) */
  79.         "TheProgram", {                /* package name for package that shows on custom */
  80.             'infa', faProgram;
  81.             'inaa', aaAlertID;
  82.         }
  83.     }
  84. };
  85.  
  86. /***************************** Comments ************************************************/
  87. resource 'icmt' (cmtTheProgram) {
  88.     currentReleaseDate,
  89.     currentVersion,
  90.     iconTheProgram,
  91.     "This package contains TheProgram. "
  92. };
  93.  
  94. resource 'ICON' (iconTheProgram) {
  95.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  96.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  97.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  98.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  99.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  100.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  101.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  102.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  103. };
  104.  
  105.  
  106. /********************************************* File Specs ******************************************/
  107. /* Source File Specs */
  108. resource 'infs' (fsSourceProgram) {
  109.     'APPL',                                /* File Type */
  110.     'Arfz',                                /* Creator */
  111.     kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  112.     noSearchForFile,                    /* Do not search the source disk for the file */
  113.     TypeCrMustMatch,                    /* file type and creator on source disk must match */
  114.     ProgramDisk"TheProgram"                /* Path to the file */
  115. };
  116.  
  117. /* Target File Specs */
  118. resource 'infs' (fsTargetProgram) {
  119.     'APPL',                                /* File Type */
  120.     'Arfz',                                /* Creator */
  121.     0,                                    /* creation date not needed for target file specs */
  122.     noSearchForFile,                    /* Do not search the target disk for the file */
  123.     TypeCrMustMatch,                    /* not needed for target file specs */
  124.     TargetPath"TheProgram"                /* destination Path */
  125. };
  126.  
  127. /******************************************** File Atoms ************************************************/
  128. resource 'infa' (faProgram) {
  129.     format0 {
  130.         delRemove,                        /* Delete the file if remove (option-custom) is clicked    */
  131.         delInstall,                     /* Delete the target before copying new one */
  132.         copy,                             /* Copy the file to the destination */
  133.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  134.         noKeepExisting,                 /* Always replace an existing copy */
  135.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  136.         rsrcFork, dataFork,                /* Copy both forks of the file */
  137.         fsTargetProgram,                /* TARGET file spec for this file */
  138.         fsSourceProgram,                 /* SOURCE file spec for this file */
  139.         0,                                /* atom size (filled in by ScriptCheck) */
  140.         ""                                /* Atom Description (Installer will use file name) */
  141.     };
  142. };
  143.  
  144.  
  145. resource 'inaa'    (aaAlertID) {
  146.     format0 {
  147.         actBefore,
  148.         dontActOnRemove,
  149.         actOnInstall,
  150.         'infn',
  151.         aaCodeID,
  152.         ShowAlertSelector,
  153.         "Display message to user."
  154.     }
  155. };
  156.  
  157. resource 'ALRT' (aaCodeID) {
  158.     {0, 0, 150, 360},
  159.         aaCodeID,
  160.     {
  161.         OK, visible, sound1,
  162.         OK, visible, sound1,
  163.         OK, visible, sound1,
  164.         OK, visible, sound1
  165.     }
  166. };
  167.  
  168. resource 'DITL' (aaCodeID) {
  169.     {
  170.         {122, 280, 142, 348}, Button { enabled, "OK" },
  171.         {8, 64, 96, 348}, StaticText { disabled, "This space available." }
  172.     }
  173. };
  174.  
  175. INCLUDE    "ActionAtomSample.rsrc" 'infn' (1001) AS 'infn' (aaCodeID, $$Attributes);
  176.  
  177.